//
//  ViewController.m
//  3.28 练习
//
//  Created by Justsoso on 16/3/28.
//  Copyright © 2016年 Justsoso. All rights reserved.
//

#import "ViewController.h"
#import "WebImageView.h"
#import "UIImageView+WebImageVIew.h"

@interface ViewController ()

@property (nonatomic,strong) NSArray *list;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.list = @[@"http://www.apple.com.cn/mac-pro/images/static/processor.jpg",@"http://www.apple.com.cn/mac-pro/images/static/memory.jpg",@"http://www.apple.com.cn/mac-pro/images/static/graphics.jpg",@"http://www.apple.com.cn/mac-pro/images/static/storage.jpg",@"http://www.apple.com.cn/mac-pro/images/static/thermal.jpg",@"http://www.apple.com.cn/mac-pro/images/static/fan.jpg",@"http://www.apple.com.cn/mac-pro/images/static/expansion.jpg",@"http://www.apple.com.cn/mac-pro/images/static/wifi.jpg",@"http://www.apple.com.cn/mac-pro/images/static/design.jpg",@"http://www.apple.com.cn/mac-pro/images/static/comingsoon.jpg"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)btn1Pressed:(id)sender
{
    
    for (int i=0;i<self.list.count;i++)
    {
        NSString *urlStr = self.list[i];
        NSURL *url = [NSURL URLWithString:urlStr];
        WebImageView *image = [[WebImageView alloc] initWithURL:url];
        image.frame = CGRectMake((i%3)*100, (i/3)*100, 100, 100);
        [self.view addSubview:image];
    }
    
    
    
}
- (IBAction)btn2Pressed:(id)sender
{
    
}

@end
